<template>
  <div>
    <input v-model="text" type="text" name="" id="">
    <button @click="$router.push( user.includes(text) ? `/user/${text}` : '/notfound' ) ">确定跳转</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      text: '',
      user: ['tom', 'rose']
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
